Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on-prem: cockpit create image wizard (HMS-5301) #2735

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

kingsleyzissou
Copy link
Collaborator

@kingsleyzissou kingsleyzissou commented Jan 10, 2025

This PR adds some changes for us to open the create image wizard for on-prem:

  • switch to hash router
  • implement a few more store methods
  • add some more plumbing

/jira-epic COMPOSER-2411

JIRA: HMS-5301

@schutzbot schutzbot changed the title on-prem: cockpit create image wizard on-prem: cockpit create image wizard (HMS-5301) Jan 10, 2025
Copy link

codecov bot commented Jan 10, 2025

Codecov Report

Attention: Patch coverage is 39.03509% with 139 lines in your changes missing coverage. Please review.

Project coverage is 84.40%. Comparing base (a7209ce) to head (1c6e08c).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/store/cockpitApi.ts 19.26% 88 Missing ⚠️
src/store/enhancedCockpitApi.ts 36.11% 23 Missing ⚠️
...mageWizard/steps/ImageOutput/TargetEnvironment.tsx 65.00% 7 Missing ⚠️
src/store/backendApi.ts 68.18% 7 Missing ⚠️
src/test/mocks/cockpit/index.ts 20.00% 4 Missing ⚠️
src/AppCockpit.tsx 0.00% 3 Missing ⚠️
src/Utilities/useGetEnvironment.ts 66.66% 3 Missing ⚠️
src/Utilities/path.ts 33.33% 2 Missing ⚠️
src/Components/Blueprints/DeleteBlueprintModal.tsx 0.00% 1 Missing ⚠️
src/Components/edge/ImageDetails.tsx 0.00% 1 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2735      +/-   ##
==========================================
- Coverage   84.86%   84.40%   -0.47%     
==========================================
  Files         183      184       +1     
  Lines       20795    20982     +187     
  Branches     2019     2031      +12     
==========================================
+ Hits        17648    17709      +61     
- Misses       3125     3251     +126     
  Partials       22       22              
Files with missing lines Coverage Δ
src/Components/Blueprints/BlueprintDiffModal.tsx 88.46% <100.00%> (ø)
src/Components/Blueprints/BlueprintsPagination.tsx 79.06% <100.00%> (ø)
src/Components/Blueprints/BuildImagesButton.tsx 71.42% <ø> (ø)
...c/Components/CreateImageWizard/EditImageWizard.tsx 100.00% <100.00%> (ø)
...Components/CreateImageWizard/steps/Oscap/Oscap.tsx 92.62% <ø> (ø)
...Components/CreateImageWizard/steps/Oscap/index.tsx 98.21% <100.00%> (-0.07%) ⬇️
...ents/CreateImageWizard/steps/Packages/Packages.tsx 79.63% <ø> (ø)
...ponents/CreateImageWizard/steps/Packages/index.tsx 100.00% <100.00%> (ø)
...ents/CreateImageWizard/utilities/useValidation.tsx 97.41% <ø> (ø)
src/Components/ImagesTable/ImagesTableToolbar.tsx 100.00% <100.00%> (ø)
... and 15 more

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a7209ce...1c6e08c. Read the comment docs.

@kingsleyzissou kingsleyzissou marked this pull request as ready for review January 10, 2025 16:27
@kingsleyzissou
Copy link
Collaborator Author

This depends on #2704

@kingsleyzissou kingsleyzissou force-pushed the cockpit_wizard branch 2 times, most recently from d5adf33 to 1c6e08c Compare January 13, 2025 09:39
@kingsleyzissou kingsleyzissou marked this pull request as draft January 13, 2025 09:40
@kingsleyzissou
Copy link
Collaborator Author

Marking as draft as this also depends on #2739

@kingsleyzissou kingsleyzissou force-pushed the cockpit_wizard branch 3 times, most recently from afa0ced to ba3bf8a Compare January 20, 2025 12:13
@kingsleyzissou kingsleyzissou marked this pull request as ready for review January 20, 2025 12:14
kingsleyzissou and others added 11 commits January 23, 2025 14:11
The browser router doesn't seem to work inside cockpit, switching
to the hashrouter resolves this.
Switch the useFlag usage to the stub function defined in the
`useGetEnvironment` utility
We need to check for the on-prem use case
We were making a call to a dead endpoint to get the architectures.
Instead, create a custom query function to return the list of architectures
and image types.
Create a get blueprint endpoint for the on-prem store.
Create the boilerplate function for getting the Oscap profiles. We will
need to make a call to the `oscap` binary to get this information. So
we will leave it empty for now.
Create a helper hook for RTK prefetch queries. This wrapper function
is needed since the imagebuilderApi and cockpitApi aren't at parity
yet.
Currently, the wizard still needs some of the other stores. If we
omit them, the wizard fails to launch
Including an image in the on prem version inside cockpit is not
trivial. We need a bit of a workaround to get the various target icons
showing on the on-prem version in cockpit.
For a start, we will disable custom repositories and the OpenSCAP steps
for the on-prem version of the frontend.
@kingsleyzissou kingsleyzissou force-pushed the cockpit_wizard branch 2 times, most recently from 2efa12f to cb3d3e8 Compare January 23, 2025 15:16
Add a stub function for the `os-release` package from cockpit.
@kingsleyzissou
Copy link
Collaborator Author

kingsleyzissou commented Jan 23, 2025

Screen.Recording.2025-01-23.at.16.08.09.mov

This doesn't include:

  • package selection
  • still need to limit the arch dropdown
  • creating the blueprint

Add a hook that gets the host distro for the on-prem frontend. If there
is an issue we will fallback to the default. For the service we also
just use the default distro.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants